import request from '@/utils/request'
import {
  exportFileByUrl,
  GetParams
} from "@/utils/common.js";

// 主承业务
// 发行数据分析
export function GetIssuedataData(params) {
  return request({
    url: 'budms/underwriting/issuedata',
    method: 'get',
    params
  })
}
export function GetIssuedataDataDownloadUrl(params) {
  const url = `${
    process.env.VUE_APP_API_URL
  }/budms/underwriting/issuedata${GetParams(params)}`;
  exportFileByUrl(url, params.name + ".xls");
}
// 发行业务数据表格点击明细数据
export function GetIssuedataDataList(params) {
  return request({
    url: 'budms/underwriting/issuedata/list',
    method: 'get',
    params
  })
}
export function GetIssuedataDataListDownloadUrl(params) {
  const url = `${
    process.env.VUE_APP_API_URL
  }/budms/underwriting/issuedata/list${GetParams(params)}`;
  exportFileByUrl(url, params.name + ".xls");
}
// 主承业务概览
export function GetSummaryData(params) {
  return request({
    url: 'budms/underwriting/summary',
    method: 'get',
    params
  })
}
export function GetSummaryDataDownloadUrl(params) {
  const url = `${
    process.env.VUE_APP_API_URL
  }/budms/underwriting/summary${GetParams(params)}`;
  exportFileByUrl(url, params.name + ".xls");
}
export function GetSummaryDataDetailList(params) {
  return request({
    url: 'budms/underwriting/summarylist',
    method: 'get',
    params
  })
}
export function GetSummaryDataDetailListDownloadUrl(params) {
  const url = `${
    process.env.VUE_APP_API_URL
  }/budms/underwriting/summarylist${GetParams(params)}`;
  exportFileByUrl(url, params.name + ".xls");
}
// 手续费收入
export function GetFeeincomeData(params) {
  return request({
    url: '/budms/underwriting/feeincome',
    method: 'get',
    params
  })
}
export function GetFeeincomeDataDownloadUrl(params) {
  const url = `${
    process.env.VUE_APP_API_URL
  }/budms/underwriting/feeincome${GetParams(params)}`;
  exportFileByUrl(url, params.name + ".xls");
}
export function GetFeeincomeDataDetailList(params) {
  return request({
    url: 'budms/underwriting/feeincome/list',
    method: 'get',
    params
  })
}
export function GetFeeincomeDataDetailListDownloadUrl(params) {
  const url = `${
    process.env.VUE_APP_API_URL
  }/budms/underwriting/feeincome/list${GetParams(params)}`;
  exportFileByUrl(url, params.name + ".xls");
}
// 手续费支出
export function GetFeepayData(params) {
  return request({
    url: 'budms/underwriting/feepay',
    method: 'get',
    params
  })
}
export function GetFeepayDataDownloadUrl(params) {
  const url = `${
    process.env.VUE_APP_API_URL
  }/budms/underwriting/feepay${GetParams(params)}`;
  exportFileByUrl(url, params.name + ".xls");
}
export function GetFeepayDataDetailList(params) {
  return request({
    url: 'budms/underwriting/feepay/list',
    method: 'get',
    params
  })
}
export function GetFeepayDataDetailListDownloadUrl(params) {
  const url = `${
    process.env.VUE_APP_API_URL
  }/budms/underwriting/feepay/list${GetParams(params)}`;
  exportFileByUrl(url, params.name + ".xls");
}
// 持仓监控
export function GetMainPositionData(params) {
  return request({
    url: 'budms/underwriting/position',
    method: 'get',
    params
  })
}
export function GetMainPositionDataDownloadUrl(params) {
  const url = `${
    process.env.VUE_APP_API_URL
  }/budms/underwriting/position${GetParams(params)}`;
  exportFileByUrl(url, params.name + ".xls");
}
export function GetMainPositionDataDetailList(params) {
  return request({
    url: 'budms/underwriting/position/list',
    method: 'get',
    params
  })
}
export function GetMainPositionDataDetailListDownloadUrl(params) {
  const url = `${
    process.env.VUE_APP_API_URL
  }/budms/underwriting/position/list${GetParams(params)}`;
  exportFileByUrl(url, params.name + ".xls");
}
// 持仓利润
export function GetMainPositionprofitData(params) {
  return request({
    url: 'budms/underwriting/positionprofit',
    method: 'get',
    params
  })
}
export function GetMainPositionprofitDataDownloadUrl(params) {
  const url = `${
    process.env.VUE_APP_API_URL
  }/budms/underwriting/positionprofit${GetParams(params)}`;
  exportFileByUrl(url, params.name + ".xls");
}
export function GetMainPositionprofitDataDetailList(params) {
  return request({
    url: 'budms/underwriting/positionprofit/list',
    method: 'get',
    params
  })
}
export function GetMainPositionprofitDataDetailListDownloadUrl(params) {
  const url = `${
    process.env.VUE_APP_API_URL
  }/budms/underwriting/positionprofit/list${GetParams(params)}`;
  exportFileByUrl(url, params.name + ".xls");
}